<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <body>
        <ui:composition template="templateGeneral.xhtml">
            <ui:define name="title">Azuriraj zaposlenog</ui:define>
            <ui:define name="center">
                
                <h2 style="margin-left: 20px"><h:outputText value="Azuriranje zaposlenog" /></h2>
                <h:form id="azurirajZap">
                    <p:growl id="message" sticky="false"/>
                    <p:selectOneMenu value="#{adminDodajOsobu.selectedZaposleniString}" filter="true" filterMatchMode="contains" style="min-width: 300px">
                        <p:ajax event="change" listener="#{adminDodajOsobu.onChangeZaposleni()}" update=":azurirajZap:podaciZap"/>
                        <f:selectItem itemLabel="Odaberi zaposlenog" itemValue=""/>
                        <f:selectItems value="#{adminDodajOsobu.zaposleniList}" /> 
                    </p:selectOneMenu>
                    <h:panelGrid id="podaciZap" columns="2" cellpadding="10">

                        
                        <h:outputText value="Ime " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.korisnik.ime}" required="true" requiredMessage="Morate uneti indeks"/>

                        <h:outputText value="Prezime " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.korisnik.prezime}" required="true" requiredMessage="Morate uneti tip studija"/>

                        <h:outputText value="Adresa " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.adresa}" required="true" requiredMessage="Morate uneti ime"/>

                        <h:outputText value="Telefon " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.telefon}" required="true" requiredMessage="Morate uneti prezime"/>

                        <h:outputText value="Email " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.mail}" required="true" requiredMessage="Morate uneti adresu"/>

                        <h:outputText value="Web sajt " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.web}"/>

                        <h:outputText value="Biografija " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.cv}"/>

                        <h:outputText value="Datum isteka ugovora: " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.istekUgovora}"/>

                        <h:outputText value="Kabinet " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.kabinet}"/>

                        <h:outputText value="Konsultacije " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.selectedZaposleni.prijem}"/>
                        
                        <h:outputText value="Status" style="font-weight:bold"/>
                        <p:selectOneMenu value="#{adminDodajOsobu.selectedZaposleni.status}">
                            <f:selectItem itemValue="Aktivan" itemLabel="Aktivan"/>
                            <f:selectItem itemValue="Neaktivan" itemLabel="Aktivan"/>
                        </p:selectOneMenu>

                        <h:outputText value="Zvanje: " style="font-weight:bold"/>            
                        <p:selectOneMenu value="#{adminDodajOsobu.selectedZaposleni.zvanje}">
                            <f:selectItem itemValue="Redovni profesor" itemLabel="Redovni profesor"/>
                            <f:selectItem itemValue="Vandredni profesor" itemLabel="Vandredni profesor"/>
                            <f:selectItem itemValue="Docent" itemLabel="Docent"/>
                            <f:selectItem itemValue="Asistent" itemLabel="Asistent"/>
                            <f:selectItem itemValue="Saradnik u nastavi" itemLabel="Saradnik u nastavi"/>
                            <f:selectItem itemValue="Istrazivac" itemLabel="Istrazivac"/>
                            <f:selectItem itemValue="Laboratorijski inzinjer" itemLabel="Laboratorijski inzinjer"/>
                            <f:selectItem itemValue="Laboratorijski tehnicar" itemLabel="Laboratorijski tehnicar"/>                
                        </p:selectOneMenu>

                        <h:outputText value="Slika " style="font-weight:bold"/> 
                        <p:fileUpload fileUploadListener="#{adminDodajOsobu.uploadHandlerSlika}" mode="advanced" fileLimit="1" />


                        <p:commandButton value="Snimi" ajax="false" actionListener="#{adminDodajOsobu.azirirajZaposlenog}" rendered="#{adminDodajOsobu.imaZaposleni}"/>
                    </h:panelGrid>
                </h:form>
                </ui:define>
        </ui:composition>
    </body>
</html>
